export function searchColumns() {
  return [
    {
      prop: 'email',
      placeholder: '请输入用户邮箱(账号)',
    },
    {
      prop: 'country_name',
      type: 'select',
      dicData: this.countryList,
      filterable: true,
      typeformat(row) {
        return `(${row?.short_name}) ${row?.full_name}`
      },
      props: {
        value: 'id',
        label: 'full_name',
      },
      placeholder: '请选择国家',
    },
    {
      prop: 'status',
      type: 'select',
      dicData: [
        { value: 1, label: '待付款' },
        { value: 2, label: '已完成' },
        { value: 3, label: '取消' },
        { value: 4, label: '关闭' },
      ],
      filterable: true,
      placeholder: '请选择订单状态',
    },
    {
      prop: 'dateRange',
      type: 'daterange',
    },
  ]
}

export function tableColumns() {
  return [
    {
      label: '序号',
      prop: 'id',
    },
    {
      label: '用户ID',
      prop: 'unique_id',
    },
    {
      overHiddem: true,
      width: 180,
      align: 'left',
      label: '账号(邮箱)',
      prop: 'email',
    },
    {
      width: 120,
      align: 'right',
      label: '支付金额($)',
      prop: 'amount',
      formatter: row => row?.amount / 10000,
    },

    {
      label: '订单状态',
      prop: 'status',
      html: true,
      formatter: row =>
        `<span class="${
          row?.status === 1
            ? 'text-primary'
            : row?.status === 2
            ? 'text-success'
            : row?.status === 3
            ? 'text-warning'
            : 'text-danger'
        }">${
          row?.status === 1
            ? '待付款'
            : row?.status === 2
            ? '已完成'
            : row?.status === 3
            ? '取消'
            : '关闭'
        }</span>`,
    },
    {
      label: '国家',
      prop: 'country_name',
    },
    {
      label: 'APP版本',
      prop: 'appVersion',
    },
    {
      label: 'IP',
      prop: 'ip',
      width: 140,
    },
    {
      overHiddem: true,
      align: 'left',
      label: '活动ID',
      prop: 'activity_id',
      width: 160,
    },
    {
      overHiddem: true,
      align: 'left',
      label: '活动名称',
      prop: 'activity_name',
      width: 140,
    },
    {
      label: '产品信息',
      prop: 'remark',
    },
    {
      label: '交易编号',
      prop: 'capture_id',
    },
    {
      width: 160,
      align: 'left',
      label: '订单号',
      prop: 'order_no',
    },
    {
      width: 140,
      label: '下单时间',
      prop: 'create_time',
      formatter: row => this.$formatTime(row?.create_time),
    },

    {
      width: 140,
      label: '支付时间',
      prop: 'payment_time',
      formatter: row => (row?.payment_time == 0 ? '--' : this.$formatTime(row?.payment_time)),
    },
    {
      label: '支付方式',
      prop: 'payment_method_name',
      formatter: row => (row?.payment_method_name === null ? 'Paypal' : row?.payment_method_name),
    },
    {
      label: '收款账号',
      prop: 'account',
    },
  ]
}
